package com.spring.api.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.spring.api.entity.User;
import com.spring.api.service.UserService;
import com.spring.api.service.repository.UserRepository;

@Service
@Transactional
public class UserServiceImpl implements UserService{

	private final UserRepository userRepository;
	
	@Autowired
	public UserServiceImpl(UserRepository userRepository){
		this.userRepository = userRepository;
	}
	
	@Override
	public User findUserById(Integer userId) {
		return userRepository.findUserById(userId);
	}

}
